window.onload = function () {
    // 话费图片更改
    document.getElementById('hf').onmouseenter = function () {
        this.src = 'images/hf2.png'
    }
    document.getElementById('hf').onmouseleave = function () {
        this.src = 'images/hf1.png'
    }
    //机票图片更改
    document.getElementById('jp').onmouseenter = function () {
        this.src = 'images/fj2.png'
    }
    document.getElementById('jp').onmouseleave = function () {
        this.src = 'images/fj1.png'
    }
    // 酒店
    document.getElementById('jd').onmouseenter = function () {
        this.src = 'images/jd2.png'
    }
    document.getElementById('jd').onmouseleave = function () {
        this.src = 'images/jd1.png'
    }
    // 游戏
    document.getElementById('yx').onmouseenter = function () {
        this.src = 'images/yx2.png'
    }
    document.getElementById('yx').onmouseleave = function () {
        this.src = 'images/yx1.png'
    }
    // 加油
    document.getElementById('jy').onmouseenter = function () {
        this.src = 'images/jy2.png'
    }
    document.getElementById('jy').onmouseleave = function () {
        this.src = 'images/jy1.png'
    }
    // 火车
    document.getElementById('hc').onmouseenter = function () {
        this.src = 'images/hc2.png'
    }
    document.getElementById('hc').onmouseleave = function () {
        this.src = 'images/hc1.png'
    }
    // 众筹
    document.getElementById('zc').onmouseenter = function () {
        this.src = 'images/zc2.png'
    }
    document.getElementById('zc').onmouseleave = function () {
        this.src = 'images/zc1.png'
    }
    // 理财
    document.getElementById('lc').onmouseenter = function () {
        this.src = 'images/lc2.png'
    }
    document.getElementById('lc').onmouseleave = function () {
        this.src = 'images/lc1.png'
    }
    // 白条
    document.getElementById('bt').onmouseenter = function () {
        this.src = 'images/bt2.png'
    }
    document.getElementById('bt').onmouseleave = function () {
        this.src = 'images/bt1.png'
    }
    // 电影
    document.getElementById('dy').onmouseenter = function () {
        this.src = 'images/dy2.png'
    }
    document.getElementById('dy').onmouseleave = function () {
        this.src = 'images/dy1.png'
    }
    // 企业购
    document.getElementById('qy').onmouseenter = function () {
        this.src = 'images/qy2.png'
    }
    document.getElementById('qy').onmouseleave = function () {
        this.src = 'images/qy1.png'
    }
    // 礼品卡
    document.getElementById('lp').onmouseenter = function () {
        this.src = 'images/lp2.png'
    }
    document.getElementById('lp').onmouseleave = function () {
        this.src = 'images/lp1.png'
    }
    // 显示隐藏元素
    // var moves = document.querySelectorAll('move')
    // var drivecontents = document.querySelectorAll('drivecontent')
    // for(var i = 0;i < moves.length;i++) {
    //     moves[i].onmouseover = function() {
    //         drivecontents[i].style.display = 'none'
    //     }
    //     moves[i].onmouseleave = function() {
    //         drivecontents[i].style.display = 'block'
    //     }
    // }
    var docEl = document.documentElement;
    var stickyTopnav = document.querySelector('.sticky-topnav');
    var stickySidenav = document.querySelector('.sticky-sidenav');

    window.onscroll = function () {
        var top = docEl.scrollTop;
        //数值500和650 根据自己的滚动页面显示情况调节
        stickyTopnav.classList[top >= 500 ? 'add' : 'remove']('open');
        stickySidenav.classList[top >= 650 ? 'add' : 'remove']('open');
    }
}